home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
PCL4C33.ARJ
/
DIR.C
< prev
next >
Wrap
Text File
|
1992-08-01
|
1KB
|
55 lines
#include <stdio.h>
#include <dos.h>
#define FALSE 0
#define TRUE !FALSE
#define WORD unsigned int
void setDTA(BufPtr)
WORD BufPtr;
{union REGS reg;
reg.x.dx = (WORD) BufPtr;
reg.h.ah = 0x1A;
int86(0x21, ®, ®);
}
int FindFirst(FilePtr)
int FilePtr; /* file spec */
{union REGS reg;
reg.x.dx = FilePtr;
reg.h.ah = 0x4e;
reg.x.cx = 0;
int86(0x21, ®, ®);
if(reg.x.cflag) return(FALSE);
else return(TRUE);
}
int FindNext()
{union REGS reg;
reg.h.ah = 0x4f;
int86(0x21, ®, ®);
if(reg.x.cflag) return(FALSE);
else return(TRUE);
}
int ChangeDir(DirPtr)
int DirPtr; /* directory */
{union REGS reg;
reg.h.ah = 0x3b;
reg.x.dx = DirPtr;
int86(0x21, ®, ®);
if(reg.x.cflag) return(FALSE);
else return(TRUE);
}
int CurrentDir(DirPtr)
int DirPtr; /* directory */
{union REGS reg;
reg.h.ah = 0x47;
reg.x.si = DirPtr;
reg.h.dl = 0;
int86(0x21, ®, ®);
if(reg.x.cflag) return(FALSE);
else return(TRUE);
}